<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title> <?php echo $data['tagname'] ? $data['tagname'] : '所有标签列表'?> - <?=SITE_NAME?> </title>
<meta name="Keywords" content="<?php echo $data['tagname']?>,LooPo,乐铺,创意礼品,创意礼物,创意生日礼物,创意杂货,创意家居,创意玩具,创意T恤" />
<meta name="Description" content="<?=SITE_NAME?>-最具创意的礼品店，主营创意礼物、创意生日礼物、创意杂货、创意家居、创意玩具、创意T恤等各种国内外创意品牌产品。正品保证，7天无条件退换保证。乐铺，用心经营，真诚对待每一位顾客。" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $data['tagname']?> in LooPo" href="<?php echo $_servername?>/tag/<?php echo urlencode($data['tagname'])?>/xml/" />
<?php include VIEWS.'header.html'?>
<style type="text/css">
.tagall { line-height: 220%; word-break:keep-all }
.tagall a { padding: 2px; margin: 1px }
.tagall a:link, .tagall a:visited { text-decoration: none }

a.tw1  {color: #D65421}
a.tw2  {color: #000}
a.tw3  {color: #20A0CF}
a.tw4  {color: #D5B920}
a.tw5  {color: #D92178}
a.tw6  {color: #777}
</style>
</head>

<body>
<?php include VIEWS.'topbar.html'?>

<div id="content">

<?php include VIEWS.'leftnav.html'?>

<div id="right">

<?php include VIEWS.'sidesearch.html'?>
<h1><?php echo $data['tagname'] ? '乐铺标签：'.$data['tagname']. (count($list) ? ' &nbsp; <a title="使用RSS订阅本页更新" tabindex="100" href="/tag/'.urlencode($data['tagname']).'/xml/"><img width="30" height="14" src="/images/rss.gif" alt="RSS Feed" /></a> <a title="使用RSS邮天下订阅本页更新" href="http://www.emailrss.cn/?rss='. $_servername .'/tag/'.urlencode(urlencode($data['tagname'])).'/xml/" target="_blank"><img width="42" height="13" src="/images/rssmail.gif" alt="RSS邮天下" /></a>' : '') : '乐铺所有标签列表'?></h1>
<?php if (count($list)==0):?>

<div class="errbox roundNormal">&nbsp;&nbsp;&nbsp;本标签下目前没有任何物品，看看我们的 <a href="/tags" class="white">标签列表</a>吧！</div>

<?php else:?>

<?php if($data['tagname']):?>

    <?php include VIEWS.'shopcarinfo.html'?>

    <br clear="all" />
    <form action="">
    <div style="float:left">
    <font class="px12" style="color:#666">&nbsp;排序方式</font>
    <select name="o" class="px12" style="color:#666" onchange="javascript:submit()">
    <option value="4"<?php if($_GET['o']==4) echo ' selected="selected"'?>>喜爱程度</option>
    <option value="1"<?php if($_GET['o']==1) echo ' selected="selected"'?>>物品名称</option>
    <option value="2"<?php if($_GET['o']==2) echo ' selected="selected"'?>>价格</option>
    <option value="3"<?php if(!$_GET['o'] || $_GET['o']==3) echo ' selected="selected"'?>>更新日期</option>
    </select>
    <input type="hidden" name="p" value="<?php echo (int)$_GET['p']?>" />
    </div>
    </form>
    <br /><br clear="all" />

    <div class="itemlist" id="itemlist">
        <?php foreach ($list as $v):
        $i++;
        do_action('view_itemslist_item', array('item'=>&$v));
        ?>
        <div class="px12" style="margin-right:10px;float:right;color:#808080">查看次数: <?php echo $v['views']?></div>
        <table style="margin-left:20px">
        <tr>
        <td width="200" align="center"><div class="items" id="item<?php echo $v['id']?>"><a href="/<?php echo $v['id']?>" style="background:transparent"><img src="/images/items/s/<?php echo $v['model']?>.gif" width="150" height="150" alt="<?php echo $v['name']?>" class="<?php echo ($v['stocknum'] == 0 ? '' : ' hand')?>" /></a></div></td>

        <td>
        <font class="price">¥<?php echo preg_replace('/^(\d+)\.(\d+)$/', '$1.<font size="-2">$2</font>', $v['price1'])?></font>
        <?php if($v['price2']>0 && ($v['price2']>floatval($v['price1']))):?>&nbsp;&nbsp;<font class="price_small">特价</font><?php endif?>
        <br />
        <b><a tabindex="2" href="/<?php echo $v['id']?>" onmousedown="return cl(this,'<?php echo $v['id']?>','items:click','<?php echo $v['sig_click']?>')"><?php echo $v['name']?></a></b><br />
        <?php if($v['title']):?><b>说明：</b><?php echo $v['title']?><br /><?php endif;?>
        <b>材质：</b><?php echo $v['stuff']?><br />
        <b>型号：</b><?php echo $v['model']?><br />
        <br />

        <?php if($v['stocknum'] == 0):?>
            <a tabindex="2" href="/alertme/<?php echo $v['id']?>" onclick="javascript:alertme(<?php echo $v['id']?>);return false"><img src="/images/addtocar_alert.gif" alt="到货通知我" /></a>
            <?php else:?>
            <a tabindex="2" href="/addtocar/<?php echo $v['id']?>" onclick="javascript:addtocar(<?php echo $v['id']?>);this.href='#top'"><img src="/images/addtocar.gif" alt="加入购物车" /></a>
            <script type="text/javascript">new Draggable('item<?php echo $v['id']?>',{revert:true,onDrag:function(element){__dg(element)},onEnd:function(element){__de(element)}})</script>

        <?php endif?>

        </td>
        </tr>
        </table>
        <?php if($i<>count($list)):?><hr size="1" /><?php endif?>
    <?php endforeach?>
    </div>
    <br clear="all" />

    <img src="/images/icon_arrow_right.gif" alt="arrow right" /><a tabindex="2" href="/tag">查看更多标签……</a>

<?php else:
$tmp = $list;
function s($a,$b) {
    if ($a==$b) return 0;
    return $a['ct']>$b['ct']?-1:1;
}
usort($tmp, "s");
//最大的tag数
$mn = $tmp[0]['ct'];
unset($tmp);

//tag数量,最大数量,最小文字,最大文字
function fz($me, $maxnum=10, $min=12, $max=36) {
    $m = ($max-$min)/log($maxnum);
    $v = floor(log($me)*$m+$min);
    return $v;
}
?>

<div style="float:right" class="px12">
&#8250; <script type="text/javascript">needHelp();</script><noscript><a href="<?php echo $_servername?>/forum/service/?from=itemlist" target="_blank">需要帮助？</a></noscript>&nbsp;&nbsp;
</div>
<br /><br clear="all" />

<div class="tagall">
<?php foreach ($list as $v):if(strpos($v['name'],':')) continue;?>
<span style="font-size:<?php echo fz($v['ct'], $mn)?>px;"><a class="tw<?php echo $v['ct']?>" tabindex="1" href="/tag/<?php echo urlencode($v['name'])?>/"><?php echo $v['name']?></a></span>
&middot;
<?php endforeach?>
</div>

<div style="text-align:right;"><?php if($list['page']['next']):?><a tabindex="2" href=<?php echo $list['page']['url']?>p=<?php echo $list['page']['next']?>>更多的标签&gt;</a>&nbsp;&nbsp;<?php endif?></div>

<?php endif?>

<?php endif;?>

    </div>
</div>

<?php include VIEWS.'copyright.html'?>

</body>
</html>
